package org.grapes.wine.api.server.method.impl;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.grapes.wine.api.method.EWineMethod;
import org.grapes.wine.api.server.database.ReadData;
import org.grapes.wine.api.server.exception.MethodErrorCode;
import org.grapes.wine.api.server.method.handler.RenderDocument;
import org.grapes.wine.api.server.model.DAOName;
import org.grapes.wine.api.server.model.dao.Accomodation;
import org.grapes.wine.api.server.model.dao.Landscape;
import org.grapes.wine.api.server.model.dao.list.GetListMapFromDB;
import org.grapes.wine.api.server.persistence.DAOOperate;
import org.grapes.wine.api.server.util.HibernateHelper;
import org.grapes.wine.api.server.util.HibernateOperateState;
import org.grapes.wine.api.server.util.SQLHelper;
import org.w3c.dom.Document;

public class GetUserMethod extends RenderDocument {

	/*
	 * Method variables
	 */
	private static List param = new ArrayList();
	static {
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.grapes.wine.api.server.method.MethodCommand#execute(javax.servlet
	 * .http.HttpServletRequest)
	 */
	@Override
	public Document execute(HttpServletRequest request) throws Exception {
		Accomodation a = new Accomodation();
		a.setLocation("macao");
		a.setRelativeHotel("venetian");
		DAOOperate.create(a);
		a.setLocation("macao");
		a.setRelativeHotel("venetian resort");
		DAOOperate.create(a);
		List list = GetListMapFromDB.convert(DAOName.Accomodation);
		System.out.println(list);
		Document doc = init(request, param, list);

		return doc;
	}

	@Override
	public final String getMethodName() {
		return EWineMethod.GET_USER.methodName();
	}

	@Override
	public final List getParam() {
		return param;
	}

}
